﻿namespace WFBot.Unity.SharePoint
{
    using System;
    using Microsoft.SharePoint.ApplicationRuntime;
    using Microsoft.Practices.Unity;

    public class UnitySharePointApplication : SPHttpApplication
    {
        public IUnityContainer Container { get; protected set; }

        protected virtual void Application_Start(object sender, EventArgs e)
        {
            CreateContainer();
        }

        private void CreateContainer()
        {
            Container = new UnityContainer();
            Container.RegisterInstance<IUnityContainer>(Container);
        }

        protected virtual void Start()
        {
        }
    }
}
